package homework.organizer;

import homework.entities.Tema;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class HomeworkAddActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.homework_add_layout);
        
        
        Button addButton = (Button)findViewById(R.id.addHomeworkButton);
        
        addButton.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				
				EditText displayName = (EditText)findViewById(R.id.display_name_edittext);
				EditText title = (EditText)findViewById(R.id.title_editext);
				EditText subject = (EditText)findViewById(R.id.subject_edittext);
				EditText deadline = (EditText)findViewById(R.id.deadline_edittext);
				EditText notes = (EditText)findViewById(R.id.notes_edittext);
				
				Tema tema = new Tema(displayName.getText().toString(), title.getText().toString());
				tema.setDeadline(deadline.getText().toString());
				tema.setSubject(subject.getText().toString());
				tema.setNotes(notes.getText().toString());
				
				tema.print();
				finish();
				
				
			}
			
		});
        
        
    }

    
}
